<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>筛选数组</title>
    <script>
        // 方法1、找出大于5的数字组成一个新的数组
        var arr = [1, 6, 3, 4, 6, 7, 5, 46, 7, 8, 9, 3, 2];
        var newArr = [];
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] > 5) {
                newArr[newArr.length] = arr[i];
            }
        }


        console.log(newArr);
    </script>
</head>

<body>

</body>

</html>